</div>
<div id="footer" class="row-fluid">
	<div class="span12"><p><strong>&copy; 2013</strong></p></div>
</div>
</body>
</html>
<!-- JS -->
<?php
/*
 *  jQuery
 */
if(in_array('jquery', $plugin))
{
	echo '<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>';
	// plugins
	//echo '<script type="text/javascript" src="'.base_url().'assets/js/jquery/plugins/jquery.validate.min.js"></script>';
}

// Plugins

if(in_array('jquery_validation', $plugin))
{
	echo '<script type="text/javascript" src="http://jzaefferer.github.com/jquery-validation/jquery.validate.js"></script>';
}

/*
 *  Bootstrap
 */
echo '<script type="text/javascript" src="'.base_url().'assets/bootstrap/js/bootstrap.min.js"></script>';

// Bootstrap modal manager
//echo '<script type="text/javascript" src="'.base_url().'assets/bootstrap-modal/js/bootstrap-modalmanager.js"></script>';
//echo '<script type="text/javascript" src="'.base_url().'assets/bootstrap-modal/js/bootstrap-modal.js"></script>';

/*
 *  Leaflet
*/
if(in_array('leaflet', $plugin))
{
	echo '<script type="text/javascript" src="http://cdn.leafletjs.com/leaflet-0.4/leaflet.js"></script>';
	// plugin Markercluster
	//echo '<script type="text/javascript" src="'.base_url().'assets/leaflet/plugin/markercluster/leaflet.markercluster-src.js"></script>';
}

// other js files
if(isset($js_files))
{
	foreach($js_files as $file):
    echo '<script type="text/javascript" src="'.base_url().'assets/js/'.$file.'.js"></script>';
	endforeach;
}



/*
 * PHP page initialization
 * Transfert php variables to js variables
 */

switch($page)
{
	case 'item' : initPageItem($id) ; break;
	case 'list' : initPageList() ; break;
	default : initPageList() ;
}

function initPageItem($id)
{
	echo '<script type="text/javascript">';
	echo 'initPageItem('.$id.');';
	echo '</script>'; 
}

function initPageList()
{
	echo '<script type="text/javascript">';
	echo 'initPageList();';
	echo '</script>';
}

/*
 *  Jquery File Upload
 */

if(in_array('jquery-file-upload', $plugin))
{
	echo '
		<!-- Bootstrap and Jquery already included -->
		<!-- The jQuery UI widget factory, can be omitted if jQuery UI is already included -->
		<script src="'.base_url().'assets/jquery-file-upload/js/vendor/jquery.ui.widget.js"></script>
		<!-- The Templates plugin is included to render the upload/download listings -->
		<script src="http://blueimp.github.com/JavaScript-Templates/tmpl.min.js"></script>
		<!-- The Load Image plugin is included for the preview images and image resizing functionality -->
		<script src="http://blueimp.github.com/JavaScript-Load-Image/load-image.min.js"></script>
		<!-- The Canvas to Blob plugin is included for image resizing functionality -->
		<script src="http://blueimp.github.com/JavaScript-Canvas-to-Blob/canvas-to-blob.min.js"></script>
		<!-- Bootstrap JS and Bootstrap Image Gallery are not required, but included for the demo -->
		<script src="http://blueimp.github.com/Bootstrap-Image-Gallery/js/bootstrap-image-gallery.min.js"></script>
		<!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
		<script src="'.base_url().'assets/jquery-file-upload/js/jquery.iframe-transport.js"></script>
		<!-- The basic File Upload plugin -->
		<script src="'.base_url().'assets/jquery-file-upload/js/jquery.fileupload.js"></script>
		<!-- The File Upload file processing plugin -->
		<script src="'.base_url().'assets/jquery-file-upload/js/jquery.fileupload-fp.js"></script>
		<!-- The File Upload user interface plugin -->
		<script src="'.base_url().'assets/jquery-file-upload/js/jquery.fileupload-ui.js"></script>
		<!-- The main application script -->
		<script src="'.base_url().'assets/jquery-file-upload/js/main.js"></script>
		<!-- The XDomainRequest Transport is included for cross-domain file deletion for IE8+ -->
		<!--[if gte IE 8]><script src="'.base_url().'assets/jquery-file-upload/js/cors/jquery.xdr-transport.js"></script><![endif]-->';
}
/*
 *  Fine uploader
*/

if(in_array('fineuploader', $plugin))
{
	echo '<script src="'.base_url().'assets/fineuploader/jquery.fineuploader-3.0.js"></script>
		  <script src="'.base_url().'assets/fineuploader/main.js"></script>';
}
?>